package yhp.com.zijie.web;

import yhp.com.zijie.bean.Grade;
import yhp.com.zijie.service.GradeService;
import yhp.com.zijie.service.impl.GradeServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet(urlPatterns = "/Educational/student/gradeList")
public class ShowGradeServlet extends HttpServlet {


    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        //
        GradeService gradeService = new GradeServiceImpl();
        List<Grade> gradeList = gradeService.showGrade();

        //存储
        req.setAttribute("gradeList",gradeList);

        //转发
        req.getRequestDispatcher("add.jsp").forward(req,resp);

    }
}
